import com.wyk.mapper.UserMapper;
import com.wyk.pojo.User;
import com.wyk.service.impl.UserServiceImpl;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.time.LocalDate;
import java.util.Map;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath:application-service.xml","classpath:application-mapper.xml"})
public class TEST {
    @Autowired
    private  UserServiceImpl userService;
    @Autowired
    private UserMapper userMapperl;
    @Test
    public  void aa()  {
        User userByid = userService.findUserByid(9);
        System.out.println(userByid);
    }
    @Test
    public  void aa1()  {
     User user=new User();
     user.setSex("212312");
     user.setId(8);
     userMapperl.update(user);
        System.out.println("ok!!!");
    }
    @Test
    public void add() {
        User user=new User();
        user.setAddress("1122");
        user.setBirthday(LocalDate.now());
        user.setSex("1212");
        user.setUsername("wyk");
        userMapperl.add(user);
        System.out.println("欧克！！！！");
    }

}
